-
Notifications
You must be signed in to change notification settings - Fork 53
feat(ws): add http service paths to WS get on backend #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ws): add http service paths to WS get on backend #213
Conversation
/ok-to-test |
Ports []ImagePort `json:"ports,omitempty"` | ||
} | ||
|
||
type ImagePort struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yehudit1987 it might be more useful for the frontend if we do something more abstract like "services" (which initially only includes "HTTP" type services).
That makes it a bit easier to populate the front-end "connect" box, because rather than constructing the HTTP path in the front end we could just include the httpPath
(relative to the UI base, not absolute) rather than constructing it in the front end.
Also, stuff like "port number" don't need to be included because this is hidden from the end user.
For example (written in YAML for clarity, but payload is JSON in app):
...
services:
- httpService:
displayName: "XXXXX"
httpPath: "/workspace/{namespace}/{workspace_name}/{port_id}/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @thesuperzapper, thanks for the review! I totally agree with your suggestion—it makes more sense. I initially followed the frontend mock, but once the PR is approved, I'll update the frontend accordingly. Also, I’ve moved the location in the struct; hope that makes sense to you as well!
db2a7aa
to
8648291
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yehudit1987 thank you for the PR. Just two small comments there.
if len(val.Spec.Ports) == 0 { | ||
continue | ||
} | ||
firstPort := val.Spec.Ports[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ports that the container listens on
// - if multiple ports are defined, the user will see multiple "Connect" buttons
// in a dropdown menu on the Workspace overview page
// +kubebuilder:validation:MinItems:=1
// +listType:="map"
// +listMapKey:="id"
Ports []ImagePort `json:"ports"`
Shall we support here multiple ports here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we deliberatelly are going to always use the first port here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thesuperzapper maybe you can chime in on this one. ^
I'm good to support just one for now and do a FUP PR on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ederign I think it's a mistake (mine). Will fix it soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries @yehudit1987 ! Thank you for the PR
if displayName == "" { | ||
displayName = val.Id | ||
} | ||
basePath := "/workspace" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of my curiosity, where this /workspace path comes from?
/assign @ederign |
Signed-off-by: Yehudit Kerido <[email protected]>
Signed-off-by: Yehudit Kerido <[email protected]>
Signed-off-by: Yehudit Kerido <[email protected]>
Signed-off-by: Yehudit Kerido <[email protected]>
Signed-off-by: Yehudit Kerido <[email protected]>
Signed-off-by: Mathew Wicks <[email protected]>
3f32965
to
4e91e38
Compare
@ederign @yehudit1987 I have made significant changes in 4e91e38 I am happy to merge it now so we can unblock #188 (which will need to be rebased to remove the backend updates). |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: thesuperzapper The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
f216c3e
into
kubeflow:notebooks-v2
* Add missing ports field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add missing ports field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * mathew updates: 1 Signed-off-by: Mathew Wicks <[email protected]> --------- Signed-off-by: Yehudit Kerido <[email protected]> Signed-off-by: Mathew Wicks <[email protected]> Co-authored-by: Yehudit Kerido <[email protected]> Co-authored-by: Mathew Wicks <[email protected]>
* Add missing ports field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add missing ports field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * mathew updates: 1 Signed-off-by: Mathew Wicks <[email protected]> --------- Signed-off-by: Yehudit Kerido <[email protected]> Signed-off-by: Mathew Wicks <[email protected]> Co-authored-by: Yehudit Kerido <[email protected]> Co-authored-by: Mathew Wicks <[email protected]> Signed-off-by: CI Bot <[email protected]>
* Add missing ports field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add missing ports field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * mathew updates: 1 Signed-off-by: Mathew Wicks <[email protected]> --------- Signed-off-by: Yehudit Kerido <[email protected]> Signed-off-by: Mathew Wicks <[email protected]> Co-authored-by: Yehudit Kerido <[email protected]> Co-authored-by: Mathew Wicks <[email protected]> Signed-off-by: CI Bot <[email protected]>
* Add missing ports field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add missing ports field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * Add services field to workspace model Signed-off-by: Yehudit Kerido <[email protected]> * mathew updates: 1 Signed-off-by: Mathew Wicks <[email protected]> --------- Signed-off-by: Yehudit Kerido <[email protected]> Signed-off-by: Mathew Wicks <[email protected]> Co-authored-by: Yehudit Kerido <[email protected]> Co-authored-by: Mathew Wicks <[email protected]>
This PR is for adding missing ports field to workspace model.